Function Reference

_GUICtrlStatusBarGetRect

Retrieves the bounding rectangle of a part in a status window.

#Include <GuiStatusBar.au3>
_GUICtrlStatusBarGetRect($StatusBar, $i_part)

 

Parameters

$h_StatusBar Handle to statusbar
$i_part zero based index of panel to retrieve rectangle from

 

Return Value

Returns zero based array
    0 - Left
    1 - Top
    2 - Right
    3 - Bottom
zero otherwise.

 

Remarks

None.

 

Related

None.

 

Example


opt("MustDeclareVars", 1)

#include <GUIConstants.au3>
#Include <GuiStatusBar.au3>

Local $gui, $StatusBar1, $msg
Local $a_PartsRightEdge[4] = [100, 200, 350, -1]
Local $a_PartsText[4] = ["New Text", "More Text", "Even More Text", "Hey some more"]

$gui = GUICreate("Status Bar Get Rect", 500, -1, -1, -1, $WS_SIZEBOX)
$StatusBar1 = _GUICtrlStatusBarCreate ($gui, $a_PartsRightEdge, $a_PartsText)

Local $a_rect = _GUICtrlStatusBarGetRect ($StatusBar1, 1)
If IsArray($a_rect) Then
    _GUICtrlStatusBarSetText ($StatusBar1, "Left: " & $a_rect[0], 0)
    _GUICtrlStatusBarSetText ($StatusBar1, "Top: " & $a_rect[1], 1)
    _GUICtrlStatusBarSetText ($StatusBar1, "Right: " & $a_rect[2], 2)
    _GUICtrlStatusBarSetText ($StatusBar1, "Bottom: " & $a_rect[3], 3)
EndIf

GUISetState(@SW_SHOW)


While 1
    $msg = GUIGetMsg()
    Select
        Case $msg = $GUI_EVENT_RESIZED
            _GUICtrlStatusBarResize ($StatusBar1)
        Case $msg = $GUI_EVENT_CLOSE
            ExitLoop
        Case Else
            ;;;;;
    EndSelect
   
WEnd